﻿using WatiN.Core;

namespace Catchbase.Web.ATest.Pages.Other
{
    public class GoogleAccount
    {
        private readonly Browser _browser;

        public GoogleAccount(Browser browser)
        {
            _browser = browser;
        }

        public bool IsActive
        {
            get { return _browser.Url.StartsWith("https://accounts.google.com/ServiceLogin"); }
        }

        public void Logon(string username, string password)
        {
            _browser.TextField("Email").TypeText(username);
            _browser.TextField("Passwd").TypeText(password);
            _browser.Button("signIn").Click();
        }
    }
}